import time

# 装饰器
def timer(func):
    # 被修饰方法的入参
    def inner(*args,**kwargs):
        start = time.time();
        func(*args,**kwargs)
        print(time.time()-start)

    return inner


# 装饰器
@timer
def test(num):
    for i in range(1000000):
        print(123)


test(12)